package com.ldl.servlet.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ldl.service.LdlService;
import com.ldl.service.impl.LdlServiceImpl;
import com.ldl.util.DBHelper;

/**
 * @author Administrator
 * Author : L.D.L
 * E-mail : 1419485293@qq.com
 * Date : 2020年7月28日上午11:51:58
 */
public class LdlDeleteServlet extends HttpServlet{

	private LdlService ldlService = new LdlServiceImpl();
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		try {
			int LdlId = Integer.valueOf(request.getParameter("ldlId"));
			ldlService.delete(LdlId);
			request.setAttribute("msg", "删除用户成功");
			request.setAttribute("href", "admin/ldl-list.let");
		} catch (Exception e) {
			e.printStackTrace();//记调试日志
			request.setAttribute("error", "删除用户失败:"+e.getMessage());
		}
		request.getRequestDispatcher("/admin/msg.jsp").forward(request, response);
	}
}
